/**
* This file is part of OntoCompoFramework
*
* Copyright (C) 2011 -  Christian Brel
*
* @author   Main    Christian Brel
**/
package ontocompo.ui.appmanagement;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class TestLayout {

	public void init() {
		//boolean shouldFill = true;
		//boolean shouldWeightX = true;
		
		JFrame jf = new JFrame("Test");
		
		JPanel pane= new JPanel();
		
		jf.setContentPane(pane);
		
		JButton button;
		pane.setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
		//if (shouldFill) {
				//natural height, maximum width
		//		c.fill = GridBagConstraints.HORIZONTAL;
		//}

		button = new JButton("Button 1");
		//if (shouldWeightX) {
		//		   c.weightx = 0.5;
		//}
		
		//c.fill = GridBagConstraints.HORIZONTAL;
		c.gridx = 1;
		c.gridy = 1;
		pane.add(button, c);
/*
		button = new JButton("Button 2");
		//c.fill = GridBagConstraints.HORIZONTAL;
		//c.weightx = 0.5;
		c.gridx = 1;
		c.gridy = 0;
		pane.add(button, c);

		button = new JButton("Button 3");
		//c.fill = GridBagConstraints.HORIZONTAL;
		//c.weightx = 0.5;
		c.gridx = 2;
		c.gridy = 0;
		pane.add(button, c);

		button = new JButton("Long-Named Button 4");
		//c.fill = GridBagConstraints.HORIZONTAL;
		//c.ipady = 40;      //make this component tall
		//c.weightx = 0.0;
		//c.gridwidth = 3;
		c.gridx = 0;
		c.gridy = 1;
		pane.add(button, c);

		button = new JButton("5");
		//c.fill = GridBagConstraints.HORIZONTAL;
		//c.ipady = 0;       //reset to default
		//c.weighty = 1.0;   //request any extra vertical space
		//c.anchor = GridBagConstraints.PAGE_END; //bottom of space
		//c.insets = new Insets(10,0,0,0);  //top padding
		c.gridx = 1;       //aligned with button 2
		//c.gridwidth = 2;   //2 columns wide
		c.gridy = 2;       //third row
		pane.add(button, c);
*/		
		jf.pack();
		jf.setVisible(true);
	}
	
	public static void main(String[] args) {
		TestLayout tl = new TestLayout();
		tl.init();
	}
	
}
